/*************************************************************************
	> File Name: P1420.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-04-16 11:44:47
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    int ans = 1, cnt = 1;
    for (int i = 1; i < n; i++) {
        if (arr[i] > arr[i - 1] && arr[i] - arr[i - 1] == 1) {
            cnt++;
            ans = max(ans, cnt);
        } else {
            cnt = 1;
        } 
    }
    cout << ans << endl;
    return 0;
}
